﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Bioinformatics.UI
{
    public partial class SettingsForm : Form
    {
        public int MaximumSequencePacketLength { get; set; }
        public bool PopSet { get; set; }
        public bool Genome { get; set; }
        public bool Est { get; set; }
        public bool Gss { get; set; }
        public bool Protein { get; set; }
        public bool Nucleotide { get; set; }

        public SettingsForm()
        {
            InitializeComponent();
        }

        private void uxCancel_Click(object sender, EventArgs e)
        {
            DialogResult = DialogResult.Cancel;
        }

        private void uxSave_Click(object sender, EventArgs e)
        {
            MaximumSequencePacketLength = decimal.ToInt32(uxMaximumSequencePacketLength.Value);
            PopSet = uxPopSetCheckbox.Checked;
            Genome = uxGenomeCheckbox.Checked;
            Est = uxEstCheckbox.Checked;
            Gss = uxGssCheckbox.Checked;
            Protein = uxProteinCheckbox.Checked;
            Nucleotide = uxNucleotideCheckbox.Checked;
            DialogResult = DialogResult.OK;
        }

        private void SettingsForm_Load(object sender, EventArgs e)
        {
            uxMaximumSequencePacketLength.Value = new decimal(MaximumSequencePacketLength);
            uxPopSetCheckbox.Checked = PopSet;
            uxGenomeCheckbox.Checked = Genome;
            uxEstCheckbox.Checked = Est;
            uxGssCheckbox.Checked = Gss;
            uxProteinCheckbox.Checked = Protein;
            uxNucleotideCheckbox.Checked = Nucleotide;
        }
    }
}
